/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package packageController;

import javax.servlet.http.HttpSessionEvent;
import javax.servlet.http.HttpSessionListener;
import javax.servlet.http.HttpSession;
import packageModel.Basket;

/**
 * Web application lifecycle listener.
 * @author laurent
 */
public class bricowebListener implements HttpSessionListener 
{

    @Override
    public void sessionCreated(HttpSessionEvent se) 
    {
        Basket basket = new Basket();
        HttpSession session = se.getSession();
        session.setAttribute("basket", basket);
    }

    @Override
    public void sessionDestroyed(HttpSessionEvent se) 
    {
        HttpSession session = se.getSession();
        session.removeAttribute("basket");
    }
}
